home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / BGRAPHV.HDR < prev    next >
Text File  |  1994-04-25  |  3KB  |  102 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _BarGraphV(TopRow,TopCol,BotRow,BotCol,Degree_Prcnt,Fore_Char,Back_Char,Fore_
  8. Color,Back_Color,Final_Only,Use_Zero) --> NIL
  9.  
  10. PARAMETERS:
  11.  
  12. TopRow        : Top Row (Maximum range) of Bargraph
  13. TopCol        : Top Left Column of Bargraph
  14. BotRow        : Bottom Row (Minimum Range) of Bargraph
  15. BotCol        : Bottom Right Column of Bargraph
  16. Degree_Prcnt  : Percent of Bar to Graph
  17. Fore_Char     : Graph Charcater (what to draw with)
  18. Back_Char     : Background Character (what to draw on)
  19. Fore_color    : ForeGround Color to Use
  20. Back_Color    : background Color to Use
  21. Final_Only    : Log - Print Whole Bar or just Top Character
  22. Use_Zero      : Log - Graph Bottom char if:
  23.                 Min_Inc_Characters < Degree_Percent
  24.  
  25. SHORT:
  26.  
  27. Provides a verticle BarGraph based upon "percent."
  28.  
  29. DESCRIPTION:
  30.  
  31. _BarGraphV draw a VERTICLE bargraph with minimum and maximum ranges at
  32. the given coordinates.  It then displays the bargraph "Degree_Prcnt"
  33. percent of the min/max values.
  34.  
  35. For instance, if the BarGraph range is from row 4 down to row 13 (ten
  36. rows) and Degree_Prcnt = 50, then 50% of the bargraph will be filled from
  37. the bottom Row 13 UP TO Row 9.
  38.  
  39. The Bargraph will be drawn using character Fore_Char and the remaining
  40. unused range of the Bargraph will be drawn using Back_Char.
  41.  
  42.  
  43. The Fore_Char will be drawn using the color specified in the
  44. Fore_Color parameter and the back_Char will be drawn using the color
  45. specified in the Back_Color parameter.
  46.  
  47. If the percent to be graphed is less than can be displayed in a
  48. single character of the bargraph, USE_ZERO = .T. will cause the
  49. bottom-most character to be graphed anyway.
  50.  
  51. NOTE:
  52.  
  53. See KLIPPER.CH for alternate calling conventions using #xtrans.
  54.  
  55. EXAMPLE:
  56.  
  57. #define DEGREE 67
  58.  
  59. _Box(1,22,24,24)
  60.  
  61. @ 02,25 say '100 %'+' (' + ltrim(str(DEGREE)) + '% COMPLETE)'
  62. @ 08,25 say ' 75 %'
  63. @ 13,25 say ' 50 %'
  64. @ 18,25 say ' 25 %'
  65. @ 23,25 say '  0 %'
  66.  
  67. _BarGraphV(02,23,23,23,DEGREE,'░','─',,'b/n')
  68.  
  69. Result: A graph similar to the following is built:
  70.  
  71.  
  72. ┌───┐
  73. │ ─ │ 100%    (67% Complete)
  74. │ ─ │
  75. │ ─ │
  76. │ ─ │
  77. │ ─ │
  78. │ ─ │
  79. │ ─ │  75%
  80. │ ─ │
  81. │ ░ │
  82. │ ░ │
  83. │ ░ │
  84. │ ░ │  50%
  85. │ ░ │
  86. │ ░ │
  87. │ ░ │
  88. │ ░ │
  89. │ ░ │  25%
  90. │ ░ │
  91. │ ░ │
  92. │ ░ │
  93. │ ░ │
  94. │ ░ │   0%
  95. └───┘
  96.  
  97.  
  98. Notice that the _BarGraphV() function is responsible only for the
  99. actual bargraph itself.  The box and the labels were drawn manually.
  100.  
  101. ******************************************************************************/
  102.